Can someone explain how this IOS Pan Gesture Recognition works? [on hold]

Posted by user79894 on Programmers See other posts from Programmers or by user79894
Published on 2013-06-29T20:24:24Z Indexed on 2013/06/29 22:27 UTC
Read the original article Hit count: 273

Filed under:
|
|

It is ios app using Pan Gesture Recognizer

It works great, but I didn't get it. I wanna do some changes if the dragged UIView reaches a specific position it would call another method. Any comments are appreciated.

- (IBAction)handlePan1:(UIPanGestureRecognizer *)recognizer {

    CGPoint translation = [recognizer translationInView:self.view];
    recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x, recognizer.view.center.y + translation.y);
    [recognizer setTranslation:CGPointMake(0, 0) inView:self.view];


    /*
    [x1 setText:[NSString stringWithFormat: @"%.2f", recognizer.view.center.x]];
    [y1 setText:[NSString stringWithFormat: @"%.2f", recognizer.view.center.y]];

    [x2 setText:[NSString stringWithFormat: @"%.2f", translation.x]];
    [y2 setText:[NSString stringWithFormat: @"%.2f", translation.y]];*/

}

© Programmers or respective owner

Related posts about ios

Related posts about iphone